/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.seaworldsoft.publish.entity;

import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.TableGenerator;
import javax.persistence.Temporal;

/**
 *
 * @author sam
 */
@Entity
@Table(name = "sys_channel")
public class Article {

    @Id
    @TableGenerator(name = "article", table = "sys_generator", pkColumnName = "key_name", pkColumnValue = "Art_ID", valueColumnName = "key_value", initialValue = 1, allocationSize = 1)
    @GeneratedValue(strategy = GenerationType.TABLE, generator = "article")
    private int artId;
    /**
     * 文章标题
     */
    @Column(length = 150)
    private String artTitle;
    /**
     * 文章简介
     */
    @Column(length = 400)
    private String artDemo;
    /**
     * 文章关键词
     */
    @Column(length = 150)
    private String artKeyWord;
    /**
     * 文章介绍图
     */
    private String displayImage;
    /**
     * 文档内容
     */
    @Lob
    private String artContent;
    /**
     * 文章类型 common普通，重要import，紧急exigency
     */
    private String artType = "common";
    @OneToOne
    @JoinColumn(name = "CUSERID")
    private User createUser;
    @OneToOne
    @JoinColumn(name = "UUSERID")
    private User updateUser;
    
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date createDate;
    
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date updateDate;
      
    /**
     * 文章的附件 一对多关系
     */
    @OneToMany(mappedBy="article")
    private List<Accessory> accessories;
    
    
    
    /**
     * 文章排序号 ，默认序号大的排前面 默认为0 
     */
    private int sortNo = 0;

    public int getArtId() {
        return artId;
    }

    public void setArtId(int artId) {
        this.artId = artId;
    }

    public String getArtTitle() {
        return artTitle;
    }

    public void setArtTitle(String artTitle) {
        this.artTitle = artTitle;
    }

    public String getArtDemo() {
        return artDemo;
    }

    public void setArtDemo(String artDemo) {
        this.artDemo = artDemo;
    }

    public String getArtKeyWord() {
        return artKeyWord;
    }

    public void setArtKeyWord(String artKeyWord) {
        this.artKeyWord = artKeyWord;
    }

    public String getDisplayImage() {
        return displayImage;
    }

    public void setDisplayImage(String displayImage) {
        this.displayImage = displayImage;
    }

    public String getArtContent() {
        return artContent;
    }

    public void setArtContent(String artContent) {
        this.artContent = artContent;
    }

    public String getArtType() {
        return artType;
    }

    public void setArtType(String artType) {
        this.artType = artType;
    }

    public User getCreateUser() {
        return createUser;
    }

    public void setCreateUser(User createUser) {
        this.createUser = createUser;
    }

    public User getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(User updateUser) {
        this.updateUser = updateUser;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public List<Accessory> getAccessories() {
        return accessories;
    }

    public void setAccessories(List<Accessory> accessories) {
        this.accessories = accessories;
    }

    public int getSortNo() {
        return sortNo;
    }

    public void setSortNo(int sortNo) {
        this.sortNo = sortNo;
    }
    
    
    
}
